package org.fanpeng.demo.design;

/**
 * className: Singleton_00
 * Description:
 * date: 2021/8/4 11:13
 *
 * @author fanpeng
 * @version 1.0
 */
public class Singleton_02 {
    // 懒汉模式（线程安全）
    private static Singleton_02 instance;

    private Singleton_02(){
    }

    public static synchronized Singleton_02 getInstance() {
        if (null != instance) {
            return instance;
        }
        return new Singleton_02();
    }
}
